/**
 * FileName: DepartmentController
 * Author: Administrator
 * Date: 2018/11/21 19:13
 * Description: 部门控制器
 */
package com.cym.controller;

import com.cym.bean.Department;
import com.cym.service.DeptService;
import com.cym.utils.ComMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class DepartmentController {
    @Autowired
    private DeptService deptService;

    @RequestMapping(value = "/getDeptInfo")
    @ResponseBody
    public ComMsg getDepInfo(){
        List<Department> departmentList = deptService.getInfo();
        return ComMsg.success().add("departmentInfo",departmentList);
    }
}
